<?php


namespace App\Transformers;


use League\Fractal\TransformerAbstract;

class TaskLevelTransFormer extends TransformerAbstract
{
    public function transform($data)
    {
        return [
            'id' => $data->id,
            'task_name' => $data->task_name ?? '',
            'task_type' => $data->task_type ?? '',
            'limit_num' => $data->limit_num ?? '',
            'is_show' => $data->is_show ?? '',
            'sort' => $data->sort ?? '',
            'created_at' => $data->created_at ? $data->created_at->format("Y-m-d H:i:s") : '',
            'updated_at' => $data->updated_at ? $data->updated_at->format("Y-m-d H:i:s") : '',
        ];
    }
}
